package com.molihub.utils;

import java.io.UnsupportedEncodingException;

/**
 * @ClassName: UrlUtils
 * @Description: 处理URL的编码解码问题
 * @author: GGBOY
 * @date 2020/2/1 23:36
 * @Version: 1.0
 **/
public class UrlUtils {

    /**
     * URL解码
     *
     * @param str 需要解码的URL
     * @return java.lang.String
     * @author GGBOY
     * @date 2020/2/1
     */
    public static String getURLDecoderString(String str) {
        String result = "";
        if (null == str) {
            return "";
        }
        try {
            result = java.net.URLDecoder.decode(str, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return result;
    }
}
